<div id="data_page" class="in_page">
  <div class="panel panel-default">
  <div class="panel-body">
    <form class="form-inline" method="get" id="register">
    <div class="form-group">
      <label for="keyword" >搜索</label>
      <input type="text"  name="keyword" id="keyword" placeholder="客户姓名手机号"  value="{$whereArr.keyword}" >      
      <select id="type" name="type">
        <option value="">请选择项目</option>
        <volist name="list_apt" id="arr">
        <option value="{$arr['id']}"  <if condition="$whereArr['type'] eq $arr['id']"> selected="selected" </if>>{$arr['name']}</option>
        </volist> 
      </select>
       
      <select id="type_customer" name="type_customer">
        <option value="">请选择客户类型</option> 
        <option value="1" <if condition="$whereArr['status_customer'] eq 1"> selected="selected" </if>>普通用户</option>
        <option value="2" <if condition="$whereArr['status_customer'] eq 2"> selected="selected" </if>>优质用户</option>
      
      </select>
    </div>
      <button type="button" id="sub" d_url="customer_list" class="btn btn-sm btn-default fBtn">查找</button>
      <button type="button" id="export" d_url="exportcsv_customer" class="btn btn-sm btn-default fBtn">导出</button>
</form>
  </div>
</div>
      <table class="table table-bordered" style="text-align:center">
        <thead>
          <tr>
           <!--  <th><span class="glyphicon glyphicon-leaf"></span>ID</th> -->
            <th><span class="glyphicon glyphicon-leaf"></span>姓名</th>
            <th><span class="glyphicon glyphicon-leaf"></span>手机号</th>
            <th><span class="glyphicon glyphicon-leaf"></span>性别</th>
            <th><span class="glyphicon glyphicon-leaf"></span>小区</th>
            <th><span class="glyphicon glyphicon-leaf"></span>房号</th>
            <th><span class="glyphicon glyphicon-leaf"></span>邮箱</th>
            <th><span class="glyphicon glyphicon-leaf"></span>生日</th>
            <th><span class="glyphicon glyphicon-leaf"></span>客户类型</th>
            <th><span class="glyphicon glyphicon-leaf"></span>操作</th>
          </tr>     
        </thead>
        <tbody>
         <volist name="list['list']" id="data">
          <tr>
            <td>{$data['name']}</td>
            <td>{$data['phone']}</td>           
            <td><if condition="$data['sex'] eq '1'">男</if><if condition="$data['sex'] eq '2'">女</if></td>
            <td>{$data['names']}</td>
            <td>{$data['num']}</td>
            <td>{$data['email']}</td>
            <td>{$data['birth']}</td>
            <td style="text-align: center">
            	<if condition="$data['status_customer'] eq 1">普通用户</if>
            	<if condition="$data['status_customer'] eq 2"><font color="green">优质用户</font></if>
            </td>
            <td>
            <a href="{:U('customer_edit',array('id'=>$data['id']))}">
              <button type="button" class="btn btn-sm btn-success" >修改</button>
            </a>
            <if condition="$data['status_customer'] eq 1"> 
	            <a href="{:U('Customer/shengji',array('id'=>$data['id'],'status_customer'=>2))}"><button type="button" class="btn btn-primary btn-xs shengji">升级为优质用户</button></a>
            </if>
            <if condition="$data['status_customer'] eq 2"> 
	            <a href="{:U('Customer/shengji',array('id'=>$data['id'],'status_customer'=>1))}"  onclick="return confirm('是否确认更改为普通用户？')"><button type="buttom" class="btn btn-danger btn-xs shengji">更改为普通用户</button></a>
            </if>
                 
            </td>
          </tr>
        </volist>
        </tbody>
      </table> 
</div>
<div class="pagelist">{$list['page']} </div>
<style>
.pagelist{ text-align:right; background:#f1f1f1; padding:7px 0;}
.pagelist a{ margin:0 5px; border:#6185a2 solid 1px; display:inline-block; padding:2px 6px 1px; line-height:16px; background:#fff; color:#6185a2;}
.pagelist span{ margin:0 5px; border:#6185a2 solid 1px; display:inline-block; padding:2px 6px 1px; line-height:16px; color:#6185a2; color:#fff; background:#6185a2;}
.trr td{height: 50px; line-height: 50px}
</style>      


<script>
	$('.fBtn').click(function(){		
		$('#register').attr('action','{:U("Customer/'+ $(this).attr('d_url') +'")}');
		$('#register').submit();
	});
		
</script>